All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JToggleButton
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.AbstractButton
|
+----com.sun.java.swing.JToggleButton
- public class JToggleButton
- extends AbstractButton
- implements Accessible
An implementation of a two-state button.
The JRadioButton
and JCheckBox
classes
are subclasses of this class.
For the keyboard keys used by this component in the standard Look and
Feel (L&F) renditions, see the
JToggleButton key assignments.
Warning: serialized objects of this class will not be compatible with
future swing releases. The current serialization support is appropriate
for short term storage or RMI between Swing1.0 applications. It will
not be possible to load serialized Swing1.0 objects with future releases
of Swing. The JDK1.2 release of Swing will be the compatibility
baseline for the serialized form of Swing objects.
- See Also:
- JRadioButton, JCheckBox
-
JToggleButton()
- Creates an initially unselected toggle button
without setting the text or image.
-
JToggleButton(Icon)
- Creates an initially unselected toggle button
with the specified image but no text.
-
JToggleButton(Icon, boolean)
- Creates a toggle button with the specified image
and selection state, but no text.
-
JToggleButton(String)
- Creates an unselected toggle button with the specified text.
-
JToggleButton(String, boolean)
- Creates a toggle button with the specified text
and selection state.
-
JToggleButton(String, Icon)
- Creates a toggle button that has the specified text and image,
and that is initially unselected.
-
JToggleButton(String, Icon, boolean)
- Creates a toggle button with the specified text, image, and
selection state.
-
getAccessibleContext()
- Get the AccessibleContext associated with this JComponent
-
getUIClassID()
- Returns a string that specifies the name of the l&f class
that renders this component.
-
updateUI()
- Notification from the UIFactory that the L&F
has changed.
JToggleButton
public JToggleButton()
- Creates an initially unselected toggle button
without setting the text or image.
JToggleButton
public JToggleButton(Icon icon)
- Creates an initially unselected toggle button
with the specified image but no text.
- Parameters:
- icon - the image that the button should display
JToggleButton
public JToggleButton(Icon icon,
boolean selected)
- Creates a toggle button with the specified image
and selection state, but no text.
- Parameters:
- icon - the image that the button should display
- selected - if true, the button is initially selected;
otherwise, the button is initially unselected
JToggleButton
public JToggleButton(String text)
- Creates an unselected toggle button with the specified text.
- Parameters:
- text - the string displayed on the toggle button
JToggleButton
public JToggleButton(String text,
boolean selected)
- Creates a toggle button with the specified text
and selection state.
- Parameters:
- text - the string displayed on the toggle button
- selected - if true, the button is initially selected;
otherwise, the button is initially unselected
JToggleButton
public JToggleButton(String text,
Icon icon)
- Creates a toggle button that has the specified text and image,
and that is initially unselected.
- Parameters:
- text - the string displayed on the button
- icon - the image that the button should display
JToggleButton
public JToggleButton(String text,
Icon icon,
boolean selected)
- Creates a toggle button with the specified text, image, and
selection state.
- Parameters:
- text - the text of the toggle button.
- selected - if true, the button is initially selected;
otherwise, the button is initially unselected
updateUI
public void updateUI()
- Notification from the UIFactory that the L&F
has changed.
- Overrides:
- updateUI in class AbstractButton
- See Also:
- updateUI
getUIClassID
public String getUIClassID()
- Returns a string that specifies the name of the l&f class
that renders this component.
- Returns:
- String "ToggleButtonUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
getAccessibleContext
public AccessibleContext getAccessibleContext()
- Get the AccessibleContext associated with this JComponent
- Returns:
- the AccessibleContext of this JComponent
- Overrides:
- getAccessibleContext in class JComponent
All Packages Class Hierarchy This Package Previous Next Index